package client;

import static debug.Debug.DBUG;

import java.awt.Graphics;

import javax.swing.ImageIcon;

public class Unit implements AlfaHandeler, ClientChangeable {
	protected int x,y;
	private ImageIcon icon;

	public Unit(int x, int y) {
		this.x = x;
		this.y = y;
		icon = new ImageIcon("F:/programmering/Java/workspace/priv/Alfa Client/img/unit.png");
	}

	@Override
	public void alfaUpdate(String[] s) {
		x = Integer.parseInt(s[2]);
		y = Integer.parseInt(s[3]);
	}

	@Override
	public void draw(Graphics g) {
		g.drawImage(getIcon().getImage(),x, y,null);
	}

	private ImageIcon getIcon() {
		return icon;
	}
	
	protected int getX() {
		return x;
	}

	protected int getY() {
		return y;
	}

}
